package com.cjm.one.model.custom.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cjm.one.model.base.BaseEntity;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName custom_sign_in
 */
@Data
@TableName(value ="custom_sign_in")
public class CustomSignIn extends BaseEntity {
    /**
     * 
     */
//    @TableId(type = IdType.AUTO)
//    private Long id;

    /**
     * 
     */
    private Long customId;

    /**
     * 记录用户签到的日期
     */
    private Date signInDate;

    /**
     * 记录用户的累计签到次数
     */
    private Long signInCount;





    @TableField(exist = false)
    private static final long serialVersionUID = 1L;



    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CustomSignIn other = (CustomSignIn) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCustomId() == null ? other.getCustomId() == null : this.getCustomId().equals(other.getCustomId()))
            && (this.getSignInDate() == null ? other.getSignInDate() == null : this.getSignInDate().equals(other.getSignInDate()))
            && (this.getSignInCount() == null ? other.getSignInCount() == null : this.getSignInCount().equals(other.getSignInCount()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCustomId() == null) ? 0 : getCustomId().hashCode());
        result = prime * result + ((getSignInDate() == null) ? 0 : getSignInDate().hashCode());
        result = prime * result + ((getSignInCount() == null) ? 0 : getSignInCount().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(super.getId());
        sb.append(", customId=").append(customId);
        sb.append(", signInDate=").append(signInDate);
        sb.append(", signInCount=").append(signInCount);
        sb.append(", isDeleted=").append(super.getIsDeleted());
        sb.append(", updateTime=").append(super.getUpdateTime());
        sb.append(", createTime=").append(super.getCreateTime());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}